<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

    <div id="app">
        <input type="button" value="事件绑定" v-on:click="doIt">
        <input type="button" value="事件绑定" @click="changfood">
        <input type="button" value="事件绑定" v-on:dblclick="doIt">
    </div>
    <script src="./vue.js"></script>
    <script>
        var app = new Vue({
            el: "#app",
            data: {
                food: "西兰花炒蛋"
            },
            methods: {
                doIt: function() {
                    //逻辑
                    alert("做It");
                },
                changfood: function() {
                    //console.log(this.food);
                    this.food += "好好吃!";
                    alert(this.food);
                }
            }
        })
    </script>

</body>

</html>
<!--v-on 可以用@代替-->